package com.cssw.fyzb.web.service;


import com.cssw.fyzb.base.web.domain.AjaxPage;
import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.core.dao.video.CmfUsersVideoDao;
import com.cssw.fyzb.core.model.dodb.CmfUserVideo;
import com.ydn.dbframe.plugin.activerecord.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;


/**
 * @author
 */
@Service
public class CmfUsersVideoService {

    @Autowired
    private CmfUsersVideoDao cmfUsersVideoDao;

    public AjaxPage list(int limit, int page, Map param) {
        Page<CmfUserVideo> list = cmfUsersVideoDao.list(limit, page, param);
        return AjaxPage.success(list.getList(), list.getTotalRow(), list.getTotalPage());
    }

    public AjaxData audit(Long videoId){
        return AjaxData.success(cmfUsersVideoDao.audit(videoId));
    }

    public AjaxData reject(Long videoId){
        return AjaxData.success(cmfUsersVideoDao.reject(videoId));
    }
}
